$(function(){
	var row = $('#datagrid').datagrid('getSelected');
	console.log(row);
	var datagrid; //定义全局变量datagrid
	var editRow = undefined;
	
	datagrid=$('#export-datagrid').datagrid({
	    url: contextpath+'/report/form/params?formId='+row.id,
	    width: 498,
	    columns: [[
	                {field: 'name', title: '参数 ', width: 100},
	                {field: 'description', title: '描述 ', width: 100},
	                {field: 'type', title: '类型选择', width: 100},
	                {field: 'value', title: '默认值 ',editor:{type:"validatebox",options: { required: true}}, width: 80}
	            ]],
	            onAfterEdit: function (rowIndex, rowData, changes) {
	                //endEdit该方法触发此事件
	                console.info(rowData);
	                editRow = undefined;
	            },
	            onDblClickRow: function (rowIndex, rowData) {
	            //双击开启编辑行
	                if (editRow != undefined) {
	                    datagrid.datagrid("endEdit", editRow);
	                }
	                if (editRow == undefined) {
	                    datagrid.datagrid("beginEdit", rowIndex);
	                    editRow = rowIndex;//给editRow对象赋值，index为当前行的索引
	                }
	            }
	            
	}); 
});

